function f = sq2(x)
% Scaled Quadratic SQ2   
%x0=[1,2,...,n]...  
%fmin=n/2,m=20
%Author:shi yangyang
n=length(x);
f=0;
for i=1:100
    f=f+x(i)*x(i);
end
for i=101:n
    f=f+i*x(i)*x(i);  
end
f=f/2.0;